home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 12
/
012.d81
/
house inventory
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
13KB
|
388 lines
1 gosub60000
10 fordi=49152to49415:readda:pokedi,da:next
20 me=0
30 print"[147]":f=53280:pokef,0:pokef+1,0
40 rem poke808,234
50 poke53265,11:printchr$(142)
60 close1:close2:close15:print"[147][159] ";
70 pokef,4:pokef+1,6:ifpeek(788)=76thensys820
80 print"***** household inventory program ******";
90 print" **** version 3.2 **** [154]"
100 rem r.w. kober wrote this program
110 rem version 3.2 march 24,1985
120 printtab(15)"[145][159] [146]"
130 printtab(15)"[159] *menu* [146] "
140 printtab(15)"[159] [146] "
150 print" [159]1[146][150] = read file data on screen."
160 print" [159]2[146][150] = create a new file."
170 print" [159]3[146][150] = edit or insert into a file."
180 print" [159]4[146][150] = print file data to printer."
190 print" [159]5[146][150] = list file directory."
200 print" [159]6[146][150] = help (information)."
210 print" [159]7[146][150] = scratch a file."
220 print" [159]e[146][150] = exit inventory program."
230 print"[158] '\' returns to menu at any prompt [146][154]":h=0:ds=0
240 ifme<1thenprinttab(26)"[155]by bob kober"
250 ifme<1thenprinttab(27)"apr 1,1985[154]":gosub2760
260 ifme<1thenformu=820to907:readno:pokemu,no:next:me=1:print"[145][145][145][159]":goto130
270 gosub1720:poke19,0:ifr$="e"then2800
280 ifr$="\"then60
290 ifr$="^"thenr$="5"
300 poke54296,0:r=val(r$):ifr<1orr>7then270
310 ifr>0andr<5thenclose15:open15,8,15
320 z=r:onrgoto460,330,460,460,2590,1780,2910
330 pokef,2:pokef+1,2:gosub1580
340 print:print" [158] warning!!! [146] any existing file with "
350 print" this name will be replaced!![154]"
360 print"[145][145][145][145][145][145][145][145][145]"
370 print:print"[144] enter new filename ";
380 gosub2600:ifk$="^"thensys49152:goto330
390 po=1
400 ifkf=2then330
410 ifkf=1thenprint"[145][145]":goto370
420 close2:open2,8,5,"@0:"+f$+",s,w":gosub2150
430 ifz=3thenprint"[147]":goto880
440 gosub1210:ifcthengosub1460:goto440
450 goto810
460 ifz=1thenpokef,11:pokef+1,11
470 ifz=3thenpokef,6:pokef+1,6
480 ifz=4thenpokef,9:pokef+1,9
490 gosub1580
500 print:print"[158] enter filename ";
510 ifz=1thenprint:print" (wild cards may be used)"
520 ifz=3thenprint:print" [158] warning! [146] [159]the existing file with"
530 ifz=3thenprint" this name will be edited!!![145][145][158]"
540 ifz=1orz=3thenprinttab(18)"[145][145][145][145]";
550 gosub2600:ifk$="^"thensys49152:goto460
560 ifkf=2then460
570 ifkf=1thenprint"[145][145]":goto500
580 close1:open1,8,6,"0:"+f$+",s,r":gosub2150
590 x$=""
600 ifz=4then2190
610 ifz=2then340
620 ifz=3then420
630 gosub3120:ifms=1thenms=0:goto60
640 ifms=2thengosub1750:ifr$="\"then60
650 ifms=2then580
660 gosub1490:ifc>1then750
670 gosub1420:ifcthen760
680 gosub1490:ifc>1then760
690 gosub1430:ifcthen760
700 gosub1490:ifc>1then760
710 gosub1430:ifcthen760
720 gosub1650
730 gosub1750:ifr$<>"\"then660
740 goto810
750 print"[147] end of mode #1 [146] done reading data file":print
760 gosub1650
770 ifc=1thenprinttab(11)"[159] end of data file! [146][154]":goto800
780 ifc>1andst<>64thenprint"disk error ( status = ";st;")"
790 printtab(11)"[159] end of data file! [146][154]"
800 gosub1710
810 close1:close2:close15:i9$="":ifr$="^"thensys49152
820 goto60
830 gosub1490:ifc>1then1120
840 ifz=3andleft$(i$,len(i9$))=i9$thengosub1580:goto890
850 print" now copying : [158]"i$" [145][145][154]"
860 gosub1460:ifc=1then1120
870 ifi9$<>""then830
880 gosub1490:ifc>1then1120
890 gosub1580:gosub1430:gosub1650:print"[145] [158]desired action: (enter by number)"
900 print" [150]1[154][146] = copy this item with no changes."
910 print" [150]2[154][146] = [150] delete [146][154] this item."
920 print" [150]3[154][146] = insert items before this one."
930 print" [150]4[154][146] = search until item is found."
940 print" [150]\[154][146] = return to the main menu."
950 print" [158]action ? ";:poke204,0
960 gosub1720:ifr$="\"thenprint"[158]ok-please wait while all items are re-copied[154]"
970 ifr$="\"theni9$="qzqzqzqz":goto840
980 r=val(r$):ifr<1orr>4then960
990 printtab(10)" ";r$;" [146][154]":print" [145][158] okay [146][154]":ford=1to500:next
1000 i9$="":on r goto860,1010,1030,1060,810
1010 ifc=1then1120
1020 goto880
1030 i9$=i$:w9$=w$:m9$=m$:s9$=s$:d9$=d$:v9$=v$:c9=cc
1040 gosub1210:ifcthengosub1460:goto1040
1050 i$=i9$:w$=w9$:m$=m9$:s$=s9$:d$=d9$:v$=v9$:c=c9:goto890
1060 gosub1580:print" all entries will be copied until"
1070 print:print" desired item is found;"
1080 print:print:print" enter item to search for:"
1090 input" [158]end[157][157][157][157][157][154]";i9$
1100 ifleft$(i9$,1)="\"thenr$="\":print"search aborted! please wait":goto970
1110 print" wait!! searching for ";i9$:goto840
1120 ifi9$="qzqzqzqz"thenh=1:goto1140
1130 k=0
1140 gosub1580:ifc>1then780
1150 ifh<>1thenprint"[150] end of input file!"
1160 ifh<>1thenprint:print" do you want to add any entries to the"
1170 ifh<>1thenprint:print" end of this data file?";
1180 gosub1660:ifr$="n"thenprinttab(5)" [158] okay [146][154] returning to menu":goto810
1190 gosub1210:ifcthengosub1460:goto1190
1200 goto810
1210 c=0:print"[147][144] enter item information":print" d = done entering data"
1220 print" e = error, restart entire item"
1230 print:print" do not use ',' or ':' within the data"
1240 print:print" press return[146] after each entry"
1250 gosub1650:input"[144] item [146] ?[157][157][157]";i$:ifi$="e"then1210
1260 ifi$="d"then1400
1270 input " make [146] ?[157][157][157]";w$:if w$="e"then1210
1280 ifw$="d"then1400
1290 input" model [146] ?[157][157][157]";m$:if m$="e"then1210
1300 ifm$="d"then1400
1310 input" serial #/id [146] ?[157][157][157]";s$:ifs$="e"then1210
1320 ifs$="d"then1400
1330 input" date acq'd [146] (month/day/year) ?[157][157][157]";d$:if d$="e"then1210
1340 d$=left$(d$,8):ifd$="d"then1400
1350 input" $ value [146] ?[157][157][157]";v$:ifv$="e"then1210
1360 ifv$="d"then1400
1370 gosub1420:gosub1650
1380 print"[158] is this entry correct?";:gosub1660:ifr$="n"then1210
1390 c=1:po=0:return
1400 printtab(7)"[150]returning to the menu-----":ifpo=0thenreturn
1410 close15:open15,8,15:print#15,"s:"f$:return
1420 print"[147]";
1430 print"[153] item:[146] ";i$:print" make:[146] ";w$:print" model[146] ";m$
1440 print" serial #/id:[146] ";s$
1450 print" date acq'd:[146] "d$;tab(22);" value:[146] $";v$;"[154]":print:return
1460 x$=i$:gosub1480:x$=w$:gosub1480:x$=m$:gosub1480
1470 x$=s$:gosub1480:x$=d$:gosub1480:x$=v$
1480 print#2,x$;chr$(13);:goto2150
1490 gosub1560:i$=x$:ifcthenreturn
1500 gosub1560:w$=x$:ifcthenreturn
1510 gosub1560:m$=x$:ifcthenreturn
1520 gosub1560:s$=x$:ifcthenreturn
1530 gosub1560:d$=x$:ifcthenreturn
1540 gosub1560:v$=x$:ifc=2thenc=1
1550 return
1560 c=0:input#1,x$:ifstthenc=3:ifst=64thenc=2
1570 goto2150
1580 ifz=1thenprint"[147] mode #1 [146] read file data on screen":ifds=1then1650
1590 ifz=2thenprint"[147][158] mode #2 [146] create a new file"
1600 ifz=3thenprint"[147][159] mode #3 [146] edit (or append) a file"
1610 ifz=4thenprint"[147] mode #4 [146] print data file to printer"
1620 print
1630 ifz<5thenprint" enter '\' to return to the menu"
1640 ifz<5andz<>3thenprint" enter '^' to list the file directory"
1650 print"---------------------------------------[154]":print:return
1660 ifh<>1thenprint" (y/n) ? ";
1670 gosub1720:ifr$<>"y"andr$<>"n"andr$<>"\"then1670
1680 ifh<>1thenprintr$
1690 ifr$="\"thenr$="n"
1700 return
1710 print:print"[150] hit any key when ready to continue [146][154]";:goto1760
1720 getr$:ifi9$="qzqzqzqz"thenr$="n"
1730 ifr$=""then1720
1740 poke204,1:return
1750 print:print" [150] hit any key to continue, \=menu [146][154]";
1760 gosub1720:ifz=6thenreturn
1770 print:printtab(15)"[158] okay [146][154]":ford=1to100:next:print"[147]":return
1780 pokef,11:pokef+1,11:print""
1790 print"[147][146]this program is designed to write, read,";
1800 print"print, edit, or append disk data files "
1810 print"containing information on your household";
1820 prin